package com.wwmz.spring.simple.annotation.configures.configuration;

import com.wwmz.spring.simple.project.entity.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

/**
 * Created by wumz on 2020/9/27 10:59
 */
public class MyTest {


    @Test
    public void test(){
        ApplicationContext app = new AnnotationConfigApplicationContext(MyConfig.class);
        Object person = app.getBean("person");
        System.out.println(person);

        String[] beanNamesForType = app.getBeanNamesForType(Person.class);
        System.out.println(Arrays.toString(beanNamesForType));
    }
}
